<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>Hui</title>
    <link href="../css/api.css" rel="stylesheet" type="text/css" />
    <link href="../css/app.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
    </style>
</head>
<body>
    <div>


        <div class="H-theme-background-color-white H-margin-vertical-top-10 H-border-vertical-both-after">
            <div id="clear-cache" class="H-text-list H-flexbox-horizontal H-vertical-middle H-touch-active H-border-vertical-bottom-margin-left-10-after">
                <div class="H-flex-item H-padding-horizontal-both-10 H-font-size-16 H-padding-vertical-both-12">清除缓存</div>
                <span id="clear" class="H-padding-horizontal-right-10 H-display-block H-theme-font-color-666">0KB</span>
            </div>
			<div id="clear-cache" class="H-text-list H-flexbox-horizontal H-vertical-middle H-touch-active H-border-vertical-bottom-margin-left-10-after">
                <div class="H-flex-item H-padding-horizontal-both-10 H-font-size-16 H-padding-vertical-both-12">检查更新</div>
                <span id="appVersion" class="H-padding-horizontal-right-10 H-display-block H-theme-font-color-666">v1.0.0</span>
            </div>
        </div>
      <!--  <div class="H-margin-vertical-top-10 H-theme-background-color-white H-border-vertical-both-after" >
            <div onclick="feedback();" class="H-text-list H-flexbox-horizontal  H-theme-background-color-white H-border-vertical-bottom-margin-left-10-after H-vertical-middle H-touch-active">
                <div class="H-flex-item H-padding-horizontal-both-10 H-font-size-16 H-padding-vertical-both-12">问题反馈</div>
                <span class="H-icon H-padding-horizontal-right-10 H-display-block"><i class="H-iconfont H-icon-arrow-right H-theme-font-color-999 H-font-size-14 H-vertical-middle"></i></span>
            </div>
        </div>-->

		<div class="H-margin-vertical-top-10 H-theme-background-color-white H-border-vertical-both-after" >
            <div onclick="kefu();" class="H-text-list H-flexbox-horizontal  H-theme-background-color-white H-border-vertical-bottom-margin-left-10-after H-vertical-middle H-touch-active">
                <div class="H-flex-item H-padding-horizontal-both-10 H-font-size-16 H-padding-vertical-both-12">联系客服</div>
                <span class="H-icon H-padding-horizontal-right-10 H-display-block"><i class="H-iconfont H-icon-arrow-right H-theme-font-color-999 H-font-size-14 H-vertical-middle"></i></span>
            </div>
        </div>
        
		<div onclick="logout();" class="H-padding-horizontal-both-10 H-margin-vertical-top-10">
            <button class="H-button H-width-100-percent  H-font-size-15 H-outline-none H-padding-vertical-both-15 H-padding-horizontal-both-20 H-theme-background-color-497bf0 H-theme-font-color-white H-border-radius-3">退&nbsp;出</button>
        </div>
    </div>

	<script type="text/javascript" src="../script/api.js"></script>
	<script type="text/javascript" src="../script/jquery-1.12.0.min.js"></script>
	<script type="text/javascript" src="../script/app.js"></script>
    
    <script type="text/javascript">


		apiready = function(){
		
			var appVersion = api.appVersion; // 比如: 1.0.0
			$("#appVersion").html("v" + appVersion);
			
			api.getCacheSize(function(ret, err) {
				if (ret) {
					$("#clear").text((ret.size / 1000 / 1000).toFixed(2) + " M");
				} else {
					$("#clear").text("0 M");
				}
			});

		}
		
		
		//退出
		function logout(){
			
			$api.rmStorage('userinfo');
			localStorage.removeItem('username');
			localStorage.removeItem('token');
			localStorage.removeItem('portrait');
			api.sendEvent({
                name:'push_user_info'
            });
			    	
	    	$app.openWinByUrl('login','login' ,{'closeName': 'root'});
	    	api.closeToWin({
                name: 'root'
            });
			
		}
		
		function kefu(){
			$app.allowEdit = true;
			$app.bounces = false;
			$app.openWinByUrl('kefu_win_head','win_head' ,{'title': '联系客服' , 'furl':'kefu_body' , 'frame':'kefu_body'});
		}
		
		
		
		// 清除缓存
		$("#clear-cache").click(function() {
			api.clearCache(function(ret, err) {
				$("#clear").text("0 M");
				api.toast({msg:'清除成功'});
			});
		});
		
    </script>
</body>
</html>